package com.edgclub.edg.model;

import android.content.Context;
import android.text.TextPaint;
import android.text.style.URLSpan;
import android.view.View;

import com.edgclub.edg.adapter.BBDetailAdapter;
import com.edgclub.edg.utils.util.DensityUtils;


public class ReplyDetailCommentSpan extends URLSpan {

	private BBDetailAdapter.ReplyOnclickListener listener;
	private int mColor;
	Reply reply;
	int position;
	private Context mContext;

	public ReplyDetailCommentSpan(Context mContext,String url, BBDetailAdapter.ReplyOnclickListener listener,
								  int mColor,int position, Reply reply) {
		super(url);
		this.listener = listener;
		this.mColor = mColor;
		this.mContext = mContext;
		this.position = position;
		this.reply = reply;
	}

	@Override
	public void onClick(View widget) {
		if(listener!=null)
		listener.replyComment(position,reply);
	}

	@Override
	public void updateDrawState(TextPaint ds) {
		// TODO Auto-generated method stub
		super.updateDrawState(ds);
		ds.setColor(mColor);
		ds.setTextSize(DensityUtils.sp2px(mContext,15));
		ds.setUnderlineText(false);
	}
}
